﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace projekt_planet_express_doerr
{
    class SkySphere : Microsoft.Xna.Framework.DrawableGameComponent
    {
        Model skySphere;

        public SkySphere(Game1 game)
            : base(game)
        {

        }

        protected override void LoadContent()
        {
            skySphere = Game.Content.Load<Model>("Nebular3");
            base.LoadContent();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        internal void drawSphere(Matrix world, Matrix view, Matrix projection)
        {
            foreach (ModelMesh mesh in skySphere.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();
                    effect.World = world * Matrix.CreateScale(1000, 1000, 1000);
                    effect.View = view;
                    effect.Projection = projection;
                }
                mesh.Draw();
            }
        }
    }
}
